//
//  UIView+PGExtension.m
//  6期-百思不得姐
//
//  Created by 彭鹏 on 15/11/29.
//  Copyright © 2015年 彭鹏. All rights reserved.
//

#import "UIView+PGExtension.h"

@implementation UIView (PGExtension)

- (CGFloat)pg_width
{
    return self.frame.size.width;
}

- (CGFloat)pg_height
{
    return self.frame.size.height;
}

- (void)setPg_width:(CGFloat)pg_width
{
    CGRect frame = self.frame;
    frame.size.width = pg_width;
    self.frame = frame;
}

- (void)setPg_height:(CGFloat)pg_height
{
    CGRect frame = self.frame;
    frame.size.height = pg_height;
    self.frame = frame;
}

- (CGFloat)pg_x
{
    return self.frame.origin.x;
}

- (void)setPg_x:(CGFloat)pg_x
{
    CGRect frame = self.frame;
    frame.origin.x = pg_x;
    self.frame = frame;
}

- (CGFloat)pg_y
{
    return self.frame.origin.y;
}

- (void)setPg_y:(CGFloat)pg_y
{
    CGRect frame = self.frame;
    frame.origin.y = pg_y;
    self.frame = frame;
}

- (CGFloat)pg_centerX
{
    return self.center.x;
}

- (void)setPg_centerX:(CGFloat)pg_centerX
{
    CGPoint point = self.center;
    point.x = pg_centerX;
    self.center = point;
}

- (CGFloat)pg_centerY
{
    return self.center.y;
}

- (void)setPg_centerY:(CGFloat)pg_centerY
{
    CGPoint point = self.center;
    point.y = pg_centerY;
    self.center = point;
}
@end
